#pragma once
#include <grpcpp/grpcpp.h>
#include "message.grpc.pb.h"
#include "message.pb.h"
#include "data.h"
#include <memory>


using grpc::Status;
using ::message::AddFriendReq;
using ::message::AddFriendRsp;

using ::message::ReplyFriendReq;
using ::message::ReplyFriendRsp;

using ::message::SendChatMsgReq;
using ::message::SendChatMsgRsp;

using ::message::AuthFriendReq;
using ::message::AuthFriendRsp;

using ::message::TextChatMsgReq;
using ::message::TextChatMsgRsp;

using ::grpc::ServerContext;



class ChatServiceImpl final :public message::ChatService::Service
{
public:
    ChatServiceImpl()=default;

    ~ChatServiceImpl()=default;

    // 通知添加好友
    virtual Status NotifyAddFriend(ServerContext* context, 
            const AddFriendReq* request, AddFriendRsp* response) override;
    // 回应添加好友请求
    virtual Status ReplyAddFriend(ServerContext* context, 
            const ReplyFriendReq* request, ReplyFriendRsp* response) override;
    // 发送聊天消息
    virtual Status SendChatMsg(ServerContext* context, 
            const SendChatMsgReq* request, SendChatMsgRsp* response) override;
    // 通知验证好友后给对端通知
    virtual Status NotifyAuthFriend(ServerContext* context, 
            const AuthFriendReq* request, AuthFriendRsp* response) override;
    // 通知文本聊天消息
    virtual Status NotifyTextChatMsg(ServerContext* context, 
            const TextChatMsgReq* request, TextChatMsgRsp* response) override;

    bool GetBaseInfo(int uid, std::shared_ptr<UserInfo>& userInfo);

private:

};